package com.couldsail.takeaway.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.couldsail.takeaway.mapper.CategoriesMapper;
import com.couldsail.takeaway.pojo.entity.Categories;
import com.couldsail.takeaway.service.CategoriesService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@RequiredArgsConstructor// 为必要的成员变量添加构造函数

@Service
public class CategoriesServiceImpl extends ServiceImpl<CategoriesMapper, Categories> implements CategoriesService {
    @Autowired
    private  CategoriesMapper categoriesMapper;
    @Override
    public List<Categories> getAllList(Integer id) {
        QueryWrapper<Categories> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("shop_id",id);
        return categoriesMapper.selectList(queryWrapper);
    }
}
